﻿namespace FlashcardPdfCreator
{
	using System.Data.Common;

	public class DbDataReaderCardData:CardData
	{
		private static string GetString(DbDataReader reader, int index)
		{
			return (reader.GetValue(index) ?? string.Empty).ToString().Trim();
		}

		public DbDataReaderCardData(DbDataReader reader)
		{
			this.Word = GetString(reader, 0);
			this.Pronunciation = GetString(reader, 1);
			this.Example = GetString(reader, 2);
			this.Meaning = GetString(reader, 3);
			this.ExampleTranslation = GetString(reader, 4);
		}
	}
}
